#include <bits/stdc++.h>
using namespace std;
void zero()
{
    char tmp[5][3] = {'.'};
    for (int i = 0; i < 5; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            tmp[i][j] = '.';
        }
        cout << endl;
    }
    tmp[0][0] = 'x';
    tmp[0][1] = 'x';
    tmp[0][2] = 'x';
    tmp[1][0] = 'x';
    tmp[1][2] = 'x';
    tmp[2][0] = 'x';
    tmp[2][2] = 'x';
    tmp[3][0] = 'x';
    tmp[3][2] = 'x';
    tmp[4][0] = 'x';
    tmp[4][1] = 'x';
    tmp[4][2] = 'x';


    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            cout<<tmp[i][j]<<"";
        }
        cout<<'.';
        cout<<endl;
    }
}
void one()
{
    char tmp[5][3] = {'.'};
    for (int i = 0; i < 5; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            tmp[i][j] = '.';
        }
        cout << endl;
    }
    // 第一列和第二列
    for(int i = 0;i<5;i++){
        tmp[i][2] = 'x';
    }
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            cout<<tmp[i][j]<<"";
        }
        cout<<'.';
        cout<<endl;
    }
}

void two(){
    char tmp[5][3] = {'.'};
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            tmp[i][j] = '.';
        }
        cout<<endl;
    }
    for(int i = 0;i<3;i++){
        tmp[0][i] = 'x';
    }
    for(int i = 0;i<3;i++){
        tmp[4][i] = 'x';
    }
    for(int i = 0;i<3;i++){
        tmp[2][i] = 'x';
    }
    tmp[1][2] = 'x';
    tmp[3][0] = 'x';
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            cout<<tmp[i][j]<<"";
        }
        cout<<'.';
        cout<<endl;
    }
}
void three(){
    char tmp[5][3] = {'.'};
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            tmp[i][j] = '.';
        }
        cout<<endl;
    }
    for(int i = 0;i<3;i++){
        tmp[0][i] = 'x';
    }
    for(int i = 0;i<3;i++){
        tmp[4][i] = 'x';
    }
    for(int i = 0;i<3;i++){
        tmp[2][i] = 'x';
    }
    tmp[1][2] = 'x';
    tmp[3][2] = 'x';
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            cout<<tmp[i][j]<<"";
        }
        cout<<'.';
        cout<<endl;
    }
}
void four(){
    char tmp[5][3] = {'.'};
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            tmp[i][j] = '.';
        }
        cout<<endl;
    }
    for(int i = 0;i<3;i++){
        tmp[2][i] = 'x';
    }
    tmp[0][0] = 'x';
    tmp[0][2] = 'x';
    tmp[1][0] = 'x';
    tmp[1][2] = 'x';
    tmp[3][2] = 'x';
    tmp[4][2] = 'x';
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            cout<<tmp[i][j]<<"";
        }
        cout<<'.';
        cout<<endl;
    }
}
void five(){
    char tmp[5][3] = {'.'};
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            tmp[i][j] = '.';
        }
        cout<<endl;
    }
    for(int i = 0;i<3;i++){
        tmp[0][i] = 'x';
    }
    for(int i = 0;i<3;i++){
        tmp[2][i] = 'x';
    }
    for(int i = 0;i<3;i++){
        tmp[4][i] = 'x';
    }
    tmp[1][0] = 'x';
    tmp[3][2] = 'x';
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            cout<<tmp[i][j]<<"";
        }
        cout<<'.';
        cout<<endl;
    }
}

void six(){
    char tmp[5][3] = {'.'};
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            tmp[i][j] = '.';
        }
        cout<<endl;
    }
    for(int i = 0;i<3;i++){
        tmp[0][i] = 'x';
    }
    for(int i = 0;i<3;i++){
        tmp[2][i] = 'x';
    }
    for(int i = 0;i<3;i++){
        tmp[4][i] = 'x';
    }
    tmp[1][0] = 'x';
    tmp[3][2] = 'x';
    tmp[3][0] = 'x';
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            cout<<tmp[i][j]<<"";
        }
        cout<<'.';
        cout<<endl;
    }
}

void seven(){
    char tmp[5][3] = {'.'};
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            tmp[i][j] = '.';
        }
        cout<<endl;
    }
    for(int i = 0;i<3;i++){
        tmp[0][i] = 'x';
    }
   tmp[1][2] = 'x';
   tmp[2][2] = 'x';
   tmp[3][2] = 'x';
   tmp[4][2] = 'x';
   for(int i = 0;i<5;i++){
    for(int j = 0;j<3;j++){
        cout<<tmp[i][j]<<"";
    }
    cout<<'.';
    cout<<endl;
}

}
void eight(){
    char tmp[5][3] = {'.'};
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            tmp[i][j] = '.';
        }
        cout<<endl;
    }
    for(int i = 0;i<3;i++){
        tmp[0][i] = 'x';
    }
    for(int i = 0;i<3;i++){
        tmp[2][i] = 'x';
    }
    for(int i = 0;i<3;i++){
        tmp[4][i] = 'x';
    }
    tmp[1][0] = 'x';
    tmp[1][2] = 'x';
    tmp[3][2] = 'x';
    tmp[3][0] = 'x';
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            cout<<tmp[i][j]<<"";
        }
        cout<<'.';
        cout<<endl;
    }

}
void nine(){
    char tmp[5][3] = {'.'};
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            tmp[i][j] = '.';
        }
        cout<<endl;
    }
    for(int i = 0;i<3;i++){
        tmp[0][i] = 'x';
    }
    for(int i = 0;i<3;i++){
        tmp[2][i] = 'x';
    }
    for(int i = 0;i<3;i++){
        tmp[4][i] = 'x';
    }
    tmp[1][0] = 'x';
    tmp[1][2] = 'x';
    tmp[3][2] = 'x';
    for(int i = 0;i<5;i++){
        for(int j = 0;j<3;j++){
            cout<<tmp[i][j]<<"";
        }
        cout<<'.';
        cout<<endl;
    }
}
int main()
{
    int n;
    cin >> n;
    string arr;
    cin>>arr;

    for(int i = 0;i < n;i++){
        if(arr[i]- '0' == 0 ){
            zero();
        } if(arr[i] - '0'== 1){
            one();
        } if(arr[i]- '0' == 2){
            two();
        } if(arr[i] - '0'== 3){
            three();
        } if(arr[i] - '0'== 4){
            four();
        } if(arr[i] - '0'== 5){
            five();
        } if(arr[i] - '0'== 6){
            six();
        } if(arr[i]- '0' == 7){
            seven();
        } if(arr[i] - '0'== 8){
            eight();
        } if(arr[i] - '0'== 9){
            nine();
        }
    }

    return 0;
}